/*
 * Copyright (c) 2017, Li Bo/Alex Lee All rights reserved.
 * 
 * http://www.libo4dream.club/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
package com.hyts.bmsp.service.resource;



import com.hyts.bmsp.model.resource.MenuInfoBean;
import com.hyts.bmsp.model.resource.MenuInfoDTO;
import com.hyts.bmsp.model.resource.MenuInfoQueryDTO;
import com.hyts.bmsp.tool.IdUtil;
import com.hyts.bmsp.dao.resource.MenuInfoDAO;
import com.jfinal.plugin.activerecord.Page;

/**
 * @ClassName: MenuInfoServiceImpl
 * @Description: 菜单信息业务逻辑实现类
 * @author: LiBo/Alex Lee
 * @date: 2017年9月19日 下午11:50:31
 * @email: alexlibochn@china-pui.com.cn/alex.link@foxmail.com
 */
public class MenuInfoServiceImpl implements MenuInfoService {

	/* (non Javadoc)
	 * @Title: searchMenuInfos
	 * @Description: TODO
	 * @param dto
	 * @return
	 * @see com.alex.jfinal.webapp.service.resource.MenuInfoService#searchMenuInfos(com.alex.jfinal.webapp.bean.resource.MenuInfoDTO)
	 */
	@Override
	public Page<MenuInfoBean> searchMenuInfos(MenuInfoQueryDTO dto) throws IllegalArgumentException, IllegalAccessException {
		Page<MenuInfoBean> beans = MenuInfoDAO.getInstance().queryMenuListByCondition(dto);
		return beans;
	}

	/* (non Javadoc)
	 * @Title: loadMenuInfo
	 * @Description: TODO
	 * @param dto
	 * @return
	 * @see com.alex.jfinal.webapp.service.resource.MenuInfoService#loadMenuInfo(com.alex.jfinal.webapp.bean.resource.MenuInfoDTO)
	 */
	@Override
	public MenuInfoDTO loadMenuInfo(MenuInfoDTO dto) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non Javadoc)
	 * @Title: addMenuInfo
	 * @Description: TODO
	 * @param dto
	 * @return
	 * @see com.alex.jfinal.webapp.service.resource.MenuInfoService#addMenuInfo(com.alex.jfinal.webapp.bean.resource.MenuInfoDTO)
	 */
	@Override
	public Boolean addMenuInfo(MenuInfoDTO dto) {
		dto.setId(IdUtil.getUUIDIngnoreToken());
		try {
			return MenuInfoDAO.getInstance().addMenuInfo(dto);
		} catch (IllegalArgumentException | IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return false;
		}
	}

	/* (non Javadoc)
	 * @Title: editMenuInfo
	 * @Description: TODO
	 * @param dto
	 * @return
	 * @see com.alex.jfinal.webapp.service.resource.MenuInfoService#editMenuInfo(com.alex.jfinal.webapp.bean.resource.MenuInfoDTO)
	 */
	@Override
	public Boolean editMenuInfo(MenuInfoDTO dto) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non Javadoc)
	 * @Title: deleteMenuInfo
	 * @Description: TODO
	 * @param dto
	 * @return
	 * @see com.alex.jfinal.webapp.service.resource.MenuInfoService#deleteMenuInfo(com.alex.jfinal.webapp.bean.resource.MenuInfoDTO)
	 */
	@Override
	public Boolean deleteMenuInfo(MenuInfoDTO dto) {
		// TODO Auto-generated method stub
		return null;
	}

}
